<!DOCTYPE HTML>
<html lang="zh-CN">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Tools - Crazy for code </title>
    <% include head%>
</head>
<body>
    <% include nav%>

    <div class="row">
        <h1>正则表达式</h1>
    </div>
    <div class="row">
        <h4>在线测试</h4>
        <p><a href="http://regexpal.com/">regexpal</a></p>
    </div>
    <div class="row">
        <h4>常用匹配</h4>
        <table width="100%">
            <thead>
                <tr>
                    <th>代码</th>
                    <th>说明</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>.</td>
                    <td>匹配除换行符以外的任意字符</td>
                </tr>
                <tr>
                    <td>\w</td>
                    <td>匹配字母或数字或下划线或汉字</td>
                </tr>
                <tr>
                    <td>\s</td>
                    <td>匹配任意的空白符</td>
                </tr>
                <tr>
                    <td>\d</td>
                    <td>匹配数字</td>
                </tr>
                <tr>
                    <td>\b</td>
                    <td>匹配单词的开始或结束</td>
                </tr>
                <tr>
                    <td>^</td>
                    <td>匹配字符串的开始</td>
                </tr>
                <tr>
                    <td>$</td>
                    <td>匹配字符串的结束</td>
                </tr>
                <tr>
                    <td>\W</td>
                    <td>匹配任意不是字母，数字，下划线，汉字的字符</td>
                </tr>
                <tr>
                    <td>\S</td>
                    <td>匹配任意不是空白符的字符</td>
                </tr>
                <tr>
                    <td>\D</td>
                    <td>匹配任意非数字的字符</td>
                </tr>
                <tr>
                    <td>\B</td>
                    <td>匹配不是单词开头或结束的位置</td>
                </tr>
                <tr>
                    <td>[^x]</td>
                    <td>匹配除了x以外的任意字符</td>
                </tr>
                <tr>
                    <td>*</td>
                    <td>重复零次或更多次</td>
                </tr>
                <tr>
                    <td>+</td>
                    <td>重复一次或更多次</td>
                </tr>
                <tr>
                    <td>?</td>
                    <td>重复零次或一次</td>
                </tr>
                <tr>
                    <td>{n}</td>
                    <td>重复n次</td>
                </tr>
                <tr>
                    <td>{n,}</td>
                    <td>重复n次或更多次</td>
                </tr>
                <tr>
                    <td>{n,m}</td>
                    <td>重复n到m次</td>
                </tr>
            </tbody>
        </table>
    </div>

    <% include foot%>
    <% include ga%>
</body>
</html>
